﻿// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "StarrySkyWidgetController.h"
#include "AbilitySystem/Data/AttributeInfo.h"
#include "AttributeMenuWidgetController.generated.h"
struct FGameplayAttribute;
//动态多播代理广布属性信息到属性页面中
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FStarrySkyAttributeInfoSignature,const FStarrySkyAttributeInfo&,Info);
/**
 * 
 */
UCLASS(BlueprintType, Blueprintable)
class STARRYSKY_API UAttributeMenuWidgetController : public UStarrySkyWidgetController
{
	GENERATED_BODY()
public:
	virtual void BroadcastInitialValues() override;
	virtual void BindCallbacksToDependencies() override;

	UPROPERTY(BlueprintAssignable,Category="GAS|Attributes")
	FStarrySkyAttributeInfoSignature StarrySkyAttributeInfoDelegate;

protected:
	//设置AttributeInfo的蓝图实例
	UPROPERTY(EditDefaultsOnly,BlueprintReadOnly,Category="GAS|AttributeInfo")
	TObjectPtr<UAttributeInfo> AttributeInfo;

private:
	//属性变化时广播属性值
	void BroadcastAttributeInfo(const FGameplayTag& AttributeTag,const FGameplayAttribute& Attribute) const;
};
